<template>
  <div class="headPreviewContainer">
    <el-card class="box-card"
             shadow="never">

      <div class="applicationInfo">
        <div class="Divider">

          <span class="jiner">总金额</span>

          <div><vue-count-up class="countUp"
                          :options="countUpOptions"
                          :end-val="getUserHeaderDate.totalAmount?getUserHeaderDate.totalAmount:'0'" /></div>
        </div>
        <div class="Divider">

          <span class="jiner">冻结总金额</span>
          <div><vue-count-up class="countUp"
                          :options="countUpOptions"
                          :end-val="getUserHeaderDate.frozenAmount?getUserHeaderDate.frozenAmount:'0'" /></div>

        </div>
        <div class="Divider"
             style="border-right: none">

          <span class="jiner">已提现总金额</span>
          <div><vue-count-up class="countUp"
                          :options="countUpOptions"
                          :end-val="getUserHeaderDate.alreadyAmount?getUserHeaderDate.alreadyAmount:'0'" /></div>

        </div>
      </div>
    </el-card>
  </div>
</template>
	
<script>
import { getTechnicianlistHead } from '@/api/withdrawalManagement/withdrawalList/index'
import VueCountUp from 'vue-countup-v2';
export default {
  name: 'headPreview',
  data () {
    return {
      getUserHeaderDate: {},
      countUpOptions: {
        useEasing: true,
        useGrouping: true,
        separator: ',',
        decimal: '.',
        decimalPlaces: 2,
        prefix: '',
        suffix: ''
      },

    };
  },
  activated () {
    this.queryHeader()
  },
  components: {
    VueCountUp
  },
  methods: {
    async queryHeader () {
      const res = await getTechnicianlistHead({
        siteId: this.$store.state.site.info.id,
        userId: this.$store.state.user.info.userId
      })
      console.log(res)
      this.getUserHeaderDate = res
    }
  }
};
</script>
<style lang="less" scoped>
.headPreviewContainer {
  padding-bottom: 15px;
  .applicationInfo {
    display: flex;
    align-items: center;
    justify-content: center;
    .jiner {
      color: #757575;
      font-size: 18px;
    }

    .Divider {
      text-align: center;
      width: 30%;

      border-right: 1px solid #ebebeb;
      .imgIcon {
        width: 50px;
        height: 50px;
        border-radius: 50%;
      }
      span {
        color: #999;
        font-family: Inter;
        font-size: 14px;
        font-style: normal;
        font-weight: 400;
        line-height: normal;
      }
    }
    .countUp {
      margin: 3px 0 3px 0 !important;
      color: #1e6ceb !important;
      font-weight: 500 !important;
      font-size: 28px !important;
    }
    div {
      margin: 3px 0 3px 0;
      color: #1e6ceb;
      font-weight: 500;
      font-size: 28px;
    }
  }
}
</style>
	